<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
  <head>    
    <title>管理员主页</title>
    
 	<script type="text/javascript">
    	function checkPwd() {
    		var val1= document.getElementById("pwd1");
    		var val2= document.getElementById("pwd2");
    		if(val1.value != val2.value) {
    			alert("重复密码不一致");
    			return false;
    		}
    		return true;
    	}
    </script>
  </head>
  
  <body> 
  	<jsp:include page="/common/head.jsp"></jsp:include>
	<jsp:include page="/common/navgate.jsp"></jsp:include>

	<div style="margin:0px 0px 10px 200px">用户管理</div>
	<div style="margin-left:200px;border: dashed 1px  #777; height:auto!important;min-height:540px;height:540px;">
		
		<div id="userPwdEdit" style="margin:20px 20px 0px 10px; padding-left:10px;border: dashed 1px  #777">
			<div>修改密码</div>
			<form action="UserEditPwd" method="post" onsubmit="return checkPwd();">
				<input type="hidden" name="userId" value=<s:property value='#session.loginUser.userId'/> />
				<table>
					<tr>
						<td width="40%" align="right">旧密码:</td>
						<td><input type="password" name="oldUserPassword" size="15"/></td>
					</tr>
					<tr>
						<td align="right">新密码:</td>
						<td><input type="password" id="pwd1" name="userPassword" size="15"/></td>
					</tr>
					<tr>
						<td align="right">重复密码:</td>
						<td><input type="password" id="pwd2" size="15"/></td>
					</tr>
					<tr>
						<td colspan="2" align="center"><input type="submit" value="确认"></td>
					</tr>				
				</table>
			</form>
		</div>
	
		
		<div style="margin:20px 20px 0px 10px; padding-left:10px;border: dashed 1px  #777">
			<form action="UserAdd" method="post">
			<span>
				用户名:<input type="text" name="userName" size="10"/>
				密码:<input type="password" name="userPassword" size="10"/>
				<s:select list='#{1:"管理员", 2:"医生", 3:"病人"}' name="roleId" />
				<input type="submit" value="添加用户">
			</span>
			</form>
			
			<div>
				<s:action name="UserList" executeResult="true" />
			</div>
		</div>
		
	</div>
	
	<jsp:include page="/common/foot.jsp"></jsp:include>
  </body>
</html>
